#ifndef VIDEORECEVER_H
#define VIDEORECEVER_H

#include <QObject>
#include <QUdpSocket>
#include <QImage>
#include <QTimer>

typedef struct
{
    int packNum;
    int packTaken;
    char data[1024];
}ImagePackage1;

class VideoRecever : public QObject
{
    Q_OBJECT
public:
    explicit VideoRecever(QString ip, quint16 port, QObject *parent = nullptr);

private:
    QUdpSocket *socket;
    bool TaskSignal = true;
    int fps = 0;
    QTimer *timer;

public slots:
    void onReadyRead();
    void endTask();
    void onTimeout();

signals:
    void recvComplete(QImage image);
    void getFps(int);
};

#endif // VIDEORECEVER_H
